<%-- 
    Document   : ItemList
    Created on : 2012-12-2, 16:24:23
    Author     : Timmy
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="<c:url value='/css/main.css'/>" rel="stylesheet" type="text/css"/>
         <link href="<c:url value="/css/jquery-ui-1.9.2.custom.min.css" />" rel="stylesheet" type="text/css" />
         <script type="text/javascript" src="<c:url value="/scripts/jquery.js" />" ></script>
         <script type="text/javascript" src="<c:url value="/scripts/jquery-ui-1.9.2.custom.min.js" />" ></script>
        <script type="text/javascript">
            $(document).ready(function(){
               $(".btnCls").button();
            });
            function submitAuthorForm(itemName)
            {
                $("#itemName").val(itemName);
                $("#authorForm").submit();
            }
            
            function submitDetailForm(itemName)
            {
                $("#viewItemName").val(itemName);
                $("#detailForm").submit();
            }
            
            function submitPaymentForm(itemName)
            {
                $("#payItemName").val(itemName);
                $("#payForm").submit();
            }
            
        </script>
    </head>
    <body>
        <h1>Item List for <s:property value="conferenceName"/></h1>
        <table class="borderAll">
            <tr>
                <th>Item Name</th>
                <th>Item Description</th>
                <th>Category</th>
                <th>Uploaded File</th>
                <th>Status</th>
                <th>SellPrice</th>
                <th>Blind Review</th>
                <th>Action</th>
            </tr>
            <s:iterator value="displayItems">
                <tr class="<s:if test="#stat.odd == true">odd</s:if><s:else>even</s:else>">
                    <td><s:property value="ItemName" /></td>
                    <td><s:property value="ItemDescription" /></td>
                    <td> <s:property value="Category" /> </td>
                    <td><a href="#" ><s:property value="FilePath"/></a></td>
                    <td><s:property value="Status" /></td>
                    <td><s:property value="SellPrice" /></td>
                    <td width="10px"><s:property value="isBlindReview" /></td> 
                    <td>
                        <a  href="javascript:submitAuthorForm('<s:property value="ItemName" />');">Authors</a>

                        <a  href="javascript:submitDetailForm('<s:property value="ItemName" />');">Modify</a>
                        <br />
                        <a href="javascript:submitPaymentForm('<s:property value="ItemName" />');">Pay List</a>

                        <s:if test="Status == 'Not Assigned'">
                            <a href="<s:url namespace="/review" action="showReviewers_%{conferenceName}_%{ItemName}" />">Review</a> 
                        </s:if>
                            
                    </td>
                </tr>
            </s:iterator>
        </table>
        <p />
        <a  class="btnCls" href="javascript: window.location.href= '<s:url value="/conference/list_all" />';">Back</a>
        <s:form namespace="/item" action="showAuthor_%{conferenceName}" id="authorForm" name="authorForm" method="post">
            <input type="hidden" name="itemName" id="itemName" />
        </s:form>
        <s:form namespace="/item" action="modify_%{conferenceName}" id="detailForm" name="detailForm" method="post">
            <input type="hidden" name="itemName" id="viewItemName" />
        </s:form>
        <s:form namespace="/item" action="pay_%{conferenceName}" id="payForm"  method="post">
            <input type="hidden" name="itemName" id="payItemName" />
        </s:form>    
    </body>
</html>
